package com.qmds.deviceserver.type.controller;

import com.qmds.common.core.entity.DeviceType;
import com.qmds.common.core.vo.R;
import com.qmds.deviceserver.type.param.DeviceTypeAddParam;
import com.qmds.deviceserver.type.service.DeviceTypeService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * --- 代码敲烂 月薪过万 ---
 *
 * @author ShiJiaWei
 * @date 2024/9/9
 * @desc:
 */
@RestController
@RequestMapping("/app/device")
public class DeviceTypeController {

    @Resource
    private DeviceTypeService deviceTypeService;

    @GetMapping("/type/all")
    public R<List<DeviceType>> findAll() {
        return deviceTypeService.findAll();
    }

    @PostMapping("/type/add")
    public R<Integer> addDeviceType(@RequestBody DeviceTypeAddParam typeParam) {
        return deviceTypeService.addDeviceType(typeParam);
    }
}
